package test1;
import java.sql.*;
import java.util.logging.*;
//developer ahmed resposible for this Main.java
public class Main {
    public static void main(String[] args) {
        String url = "jdbc:mysql://localhost:3306/faculty";
        String user = "root";
        String pass = "";
       // String sql = "insert into student(user_name,password) values('abdelazeem','ahmed')";
        String sql = "select * from student";
        try {
            MyConnection MyDBConn = new MyConnection("localhost", "3306", "faculty", user, pass);
           // MyDBConn.ExecuteUpdate(sql);
            Connection conn = DriverManager.getConnection(url, user, pass);
            Statement st = conn.createStatement();
            ResultSet rs = st.executeQuery(sql);
            while (rs.next()) {
                String UserName = rs.getString("user_name");
                String Password = rs.getString("password");
                System.out.println("User Name is " + UserName + " and " + " Password is "+ Password );
            }
        } catch (SQLException ex) {
            Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}

